package com.xyx.ssm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xyx.ssm.dao.FranchiseeMapper;
import com.xyx.ssm.dao.UserMapper;
import com.xyx.ssm.jdbcdao.FranchiseeDao;
import com.xyx.ssm.po.Franchisee;
import com.xyx.ssm.service.FranchiseeService;
import com.xyx.ssm.util.Page;


@Service("franchiseeService")
public class FranchiseeServiceImpl implements FranchiseeService {

	
   @Autowired 
   private   FranchiseeDao franchiseeDao;
   @Autowired 
   private   FranchiseeMapper franchiseeMapper;
   public Page<Map<String, Object>> findPage(Page<Map<String, Object>> page) {
		// TODO Auto-generated method stub
		return franchiseeDao.findPage("com.xyx.ssm.jdbcdao.FranchiseeDao.SelectAllpage",page);
	}
 //zeng
@Override
public int insert(Franchisee record) {
	// TODO Auto-generated method stub
	int n=franchiseeMapper.insert(record);
	return n;
}
//修改
@Override
public int updateByPrimaryKey(Franchisee record) {
	// TODO Auto-generated method stub
	int  n=franchiseeMapper.updateByPrimaryKey(record);
	return n;
}
//gen据ID查询
@Override
public List<Franchisee> selectrFanchisee(Integer id) {
	// TODO Auto-generated method stub
	List<Franchisee> list=franchiseeDao.selectrFanchisee(id);
	return list;
}
//根据ID 删除
@Override
public int deleteByPrimaryKey(String id) {
	// TODO Auto-generated method stub
	int n = 0;
	String[] s = id.split(",");
	for (int i = 0; i < s.length; i++) {
		Integer ids = Integer.parseInt(s[i]);
		n =franchiseeMapper.deleteByPrimaryKey(ids) ;
	}
	return n;
}

}
